﻿<div class="main">
    <form id="_form" class=" form-lg  form" method="post" data-source="@Model">
        <div class="form-group">
            <label class="control-label" for="name">表名</label>
            <div class="controls">
                <div class="input-group">
                    <input placeholder="只能由字母、数字组成，首字符必须英文" type="text" maxlength="20" name="Name" id="Name" data-validate="dataType:'table',nullMsg:'请填写表名！',errorMsg:'表名填写错误',checkUrl:'@Url.Action("CheckExists",new { id = Request.QueryString["id"],fieldName="表名",area="Admin" })'" class="form-control ui-edit-readonly" />
                    <span class="input-group-btn">
                        <a href="javascript:void(0)" class="btn btn-default ui-dialog btn-modify" data-custom-params="title:'修改表名',url:'@Url.ActionUrl("ModifyName")?id=@Request.QueryString["id"]',width:'600px',height:'300px',target:'self'">修改表名</a>
                    </span>
                </div>
                <span class="help-block" id="_ValidateTips_Name"></span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="remark">标识</label>
            <div class="controls">
                <input placeholder="仅用于标识，如文章，产品" type="text" name="Remark" id="Remark" maxlength="50" data-validate="dataType:'*',nullMsg:'请填写标识！'" class="form-control" />
                <span class="help-block"></span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="value_type">应用站点</label>
            <div class="controls form-inline">
                <select class="form-control form-control-sm ui-convertData" name="SiteId" id="SiteId" data-validate="dataType:'numeric',min:1,errorMsg:'请选择应用站点!'" data-custom-params="url:'@Url.ActionUrl("LoadListByIds","Site")',textField: 'Name'">
                    <option value="0">请选择应用站点</option>
                </select>
                <button type="button" class="btn btn-default ui-dialog" data-custom-params="title:'选择站点',url:'@Url.ActionUrl("Select","Site")?objname=#SiteId',width:'600px',height:'90%',target:'_self'">选择站点</button>
                <span class="help-block">为保证检索速度和数据的独立性，一个信息表只能用于一个站点</span>
            </div>
        </div>


        <div class="form-group template_set_box" data-source="@ViewBag.TemplateSet">
            <label class="control-label">信息页默认模版</label>
            <div class="controls form-inline">
                <div class="input-group">
                    <input type="text" placeholder="信息页模板文件" maxlength="100" id="TemplateDetail" name="TemplateDetail" class="form-control form-control-sm" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default ui-dialog" data-custom-params="title:'选择信息页模板',url:'@Url.ActionUrl("Select", "TemplateManager")?objname=#TemplateDetail',width:'650px',height:'95%',target:'self'">选择</button>
                    </span>
                </div>
                <span class="help-block">信息不属于任何栏目时的默认模板</span>
            </div>
        </div>


        <div class="form-group">
            <label class="control-label" for="Orderby">默认排序</label>
            <div class="controls">
                <input type="text" name="Orderby" id="Orderby" maxlength="50" value="id desc" class="form-control" />
                <span class="help-block">管理页默认排序方式,留空则默认id desc</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="Pagesize">管理页显示数</label>
            <div class="controls">
                <input type="text" name="Pagesize" id="Pagesize" maxlength="3" value="20" class="form-control form-control-xs" />
                <span class="help-block">管理页默认显示的记录数，留空则默认20</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="DeleteProtect">菜单启用</label>
            <div class="controls checkbox">
                <label class="checkbox-inline">
                    <input type="checkbox" name="ShowMenu" id="ShowMenu" value="1" checked />启用
                </label>
                <span class="help-block">启用内容管理菜单中才会出现</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="DeleteProtect">删除保护</label>
            <div class="controls checkbox">
                <label class="checkbox-inline">
                    <input type="checkbox" name="DeleteProtect" id="DeleteProtect" value="1" checked />启用
                </label>
                <span class="help-block">启用后列表页不能直接删除</span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label" for="Xuhao">序号</label>
            <div class="controls">
                <input placeholder="仅用于排序" type="text" value="1" maxlength="4" name="Xuhao" id="Xuhao" data-validate="dataType:'numeric',min:1,errorMsg:'请填写数字'" class="form-control form-control-xs ui-queryString" />
                <span class="help-block"></span>
            </div>
        </div>


        <div class="submit-footerbar">
            <label class="control-label"></label>
            <div class="controls">
                <input type="hidden" name="Id" id="Id" value="0" />
                <input type="hidden" name="Uid" id="Uid" value="@ViewBag.Uid" />
                <input type="hidden" name="Thedate" id="Thedate" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" />
                <button type="button" class="btn btn-sm  btn-primary ui-pagePost" data-custom-params="url:'@Url.ActionUrl()',callBack:'PostRefreshBack'">提交</button>
                <button type="button" class="btn btn-sm btn-default ui-closeDialog">关闭</button>
            </div>
        </div>
    </form>
        </div>

<script type="text/javascript">
    var id = Request("id");
    if (id != "") {
        $("#_form").FormBind({ dataSourceFrom: "attr" });
    }
    else
    {
        $(".btn-modify").attr("disabled", "disbaled").text("表名");
    }
    $("#SiteId").click(function () {
        var $this = $(this);
        if ($this.children().length == 1)
        {
            $this.blur();
            $this.siblings(".btn").click();
        }
    });
</script>
